<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@include file="/context/mytags.jsp" %>
<t:base type="jquery,easyui,tools"/>
<div id="main_list" class="easyui-layout" fit="true">
    <div region="center" style="padding: 1px;">
        <t:datagrid name="qqSelectList" title="" actionUrl="quesquesController.do?select_datagrid&qsId=${qsId}" idField="id"
                    fit="true" queryMode="group" checkbox="true" pagination="false" onLoadSuccess="loadSuccess">
            <t:dgCol title="主键" field="id" hidden="true"></t:dgCol>
            <t:dgCol title="题号" field="quesNo" width="1"></t:dgCol>
            <t:dgCol title="问题名称" field="name" query="true" width="3"></t:dgCol>
            <t:dgCol title="问题类型" field="quesType" dictionary="questType" query="true" width="1"></t:dgCol>
        </t:datagrid>
    </div>
</div>

<script type="text/javascript">
    $(function () {
        var li_east = 0;
    });

    function loadSuccess() {
        var qqids = "${qqids}";
        var strs = new Array(); //定义一数组
        strs = qqids.split(","); //字符分割
        $("#qqSelectList").datagrid({
                    onLoadSuccess: function (data) {
                        var objs = data.rows;
                        for (var i = 0; i < objs.length; i++) {
                            for (var j = 0; j < strs.length; j++) {
                                if (objs[i].id == strs[j])
                                {
                                    $("#qqSelectList").datagrid('selectRow', i);
                                    break;
                                }
                            }
                        }

                    }
                }
        );
    }

</script>
